package cc.autoapi.pucong.liteflow.design.core.properties;


import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

@ConfigurationProperties(prefix = "liteflow-design")
public class LiteFlowDesignProperties {
    /**
     * 是否装配liteflow design
     */
    private boolean enable = true;

    /**
     * 只读模式
     */
    private Boolean readonly = false;
    /**
     * 需要登录
     */
    private Boolean requireLogin = true;
    /**
     * 登录有效时间 分钟
     */
    private Long loginExpire = 43200L;

    /**
     * chain表id字段
     */
    private String chainTableIdField = "id";

    /**
     * 页面设计字段名称
     */
    private String designDataField = "design_data";

    /**
     * 脚本表id字段 是否自增
     * 同时表示是否是数字主键
     */
    private Boolean scriptTableIdAutoType = false;

    /**
     * web页面入口
     */
    private String web = "/liteFlow-design-web";

    /**
     * 是否启用跨域支持
     *
     * @since 1.0.0
     */
    private boolean supportCrossDomain = true;

    @NestedConfigurationProperty
    private SecurityConfig securityConfig = new SecurityConfig();

    /**
     * 打印banner
     */
    private boolean banner = true;

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }


    public Long getLoginExpire() {
        return loginExpire;
    }

    public void setLoginExpire(Long loginExpire) {
        this.loginExpire = loginExpire;
    }

    public Boolean getReadonly() {
        return readonly;
    }

    public void setReadonly(Boolean readonly) {
        this.readonly = readonly;
    }

    public Boolean getRequireLogin() {
        return requireLogin;
    }

    public void setRequireLogin(Boolean requireLogin) {
        this.requireLogin = requireLogin;
    }

    public String getWeb() {
        return web;
    }

    public void setWeb(String web) {
        this.web = web;
    }

    public boolean isSupportCrossDomain() {
        return supportCrossDomain;
    }

    public void setSupportCrossDomain(boolean supportCrossDomain) {
        this.supportCrossDomain = supportCrossDomain;
    }

    public SecurityConfig getSecurityConfig() {
        return securityConfig;
    }

    public void setSecurityConfig(SecurityConfig securityConfig) {
        this.securityConfig = securityConfig;
    }

    public void setBanner(boolean banner) {
        this.banner = banner;
    }

    public boolean isBanner() {
        return banner;
    }

    public String getChainTableIdField() {
        return chainTableIdField;
    }

    public void setChainTableIdField(String chainTableIdField) {
        this.chainTableIdField = chainTableIdField;
    }

    public Boolean getScriptTableIdAutoType() {
        return scriptTableIdAutoType;
    }

    public void setScriptTableIdAutoType(Boolean scriptTableIdAutoType) {
        this.scriptTableIdAutoType = scriptTableIdAutoType;
    }

    public String getDesignDataField() {
        return designDataField;
    }

    public void setDesignDataField(String designDataField) {
        this.designDataField = designDataField;
    }

}

